package supermarket;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class ServerAnswer{
    public static void main(String[] args) {
        // 创建ServerSocket,Socket服务器socket初始化
        ServerSocket serverSocket = null;

        try {
            // 实例化ServerSocketsocket
            serverSocket = new ServerSocket(8888);
            // 死循环监听请求
            while (true) {
              final  Socket  socket = serverSocket.accept();
                new ServerThread(socket).start();

            }

        }  catch (IOException e) {
            e.printStackTrace();
        }
    }
}
